//
//  CategorCollectionViewCell.m
//  Coco_Music
//
//  Created by K。 on 15/6/20.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "CategorCollectionViewCell.h"

@implementation CategorCollectionViewCell
-(void)dealloc
{

    [_imageV release];
 

    [_picture release];
    [_imageV release];
    [_titleBig release];
    [_titleSmall release];
   

    [_labelSmallTitle release];
    [super dealloc];
}
-(instancetype)initWithFrame:(CGRect)frame
{
    self =  [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
    
}

-(void)createSubView
{
    
    
    
    self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.width)];
    
    self.imageV.layer.masksToBounds = YES;
    self.imageV.layer.cornerRadius = 20;
    self.imageV.layer.borderWidth = 3;
    self.imageV.layer.borderColor = [[UIColor colorWithRed:0.5 green:0.3 blue:0.4 alpha:0.8]CGColor];
    [self.contentView addSubview:self.imageV];

    self.labelSmallTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, self.frame.size.width , self.frame.size.width, self.frame.size.height-self.frame.size.width)];
    [_imageV release];
    
    self.labelSmallTitle.font = [UIFont systemFontOfSize:12.0];
        [self.contentView addSubview:self.labelSmallTitle];
    [_labelSmallTitle release];
        
    
//    self.labelSmallTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, self.contentView.frame.size.height-5 , 90, 30)];
    self.labelSmallTitle.textAlignment = NSTextAlignmentCenter;
    self.labelSmallTitle.shadowColor = [UIColor colorWithRed:244.0f/255.0f green:147.0f/255.0f blue:23.0f/255.0f alpha:1.0f];
    self.labelSmallTitle.textColor =[UIColor colorWithRed:0.2 green:0.3 blue:0.4 alpha:0.7];
    self.labelSmallTitle.font = [UIFont systemFontOfSize:12.0];
    [self.contentView addSubview:self.labelSmallTitle];

    
    

    
}





-(void)setPicture:(NSString *)picture
{
    
    if (_picture != picture) {
        _picture = [picture copy];
    }
    
    [self.imageV sd_setImageWithURL:[NSURL URLWithString:self.picture] placeholderImage:[UIImage imageNamed:@"cm2_default_artist_banner-1"]];
    
}

-(void)setTitleSmall:(NSString *)titleSmall
{
    if (_titleSmall != titleSmall) {
        _titleSmall = [titleSmall copy];
    }
    
    self.labelSmallTitle.text = self.titleSmall;
    
}

-(void)setTitleBig:(NSString *)titleBig
{
    if (_titleBig != titleBig) {
        _titleBig = [titleBig copy];
    }
    
    
}
@end
